package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.medical.domain.entity.UserCollectionEntity;
import com.ym.medical.enums.CollectLableTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 收藏有问诊记录，药品，器械，文章对象 user_collection
 *
 * @author ym
 * @date 2020-09-04
 */
@ApiModel("收藏有问诊记录，药品，器械，文章-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserCollectionUpdateParam extends BeanCovert<UserCollectionEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("null")
    private Long userId;

    @ApiModelProperty("0 问诊，1 文章， 2 视频")
    @Size(max = 2, message = "0问诊，1文章，2视频长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(CollectLableTypeEnum.class)
    private String collectionType;

    @ApiModelProperty("关联内容(站内表)")
    @Size(max = 20, message = "关联内容长度超过{max}", groups = {Add.class, Update.class})
    private String relTable;

    @ApiModelProperty("关联内容标识(站内表)")
    private Long relId;

    @ApiModelProperty("主题图片")
    @Size(max = 32, message = "主题图片长度超过{max}", groups = {Add.class, Update.class})
    private String topicImgUrl;

    @ApiModelProperty("主题描述")
    @Size(max = 255, message = "主题描述长度超过{max}", groups = {Add.class, Update.class})
    private String topicDescription;

    @ApiModelProperty("内容地址,(站外地址)")
    @Size(max = 32, message = "内容地址,长度超过{max}", groups = {Add.class, Update.class})
    private String contentUrl;

}
